package nl.hu.verbrandendephoenix.shared;

import java.util.Date;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Message implements IsSerializable {
	private int mid;
	private String text;
	private Date date;
	private int hour;
	private int min;
	private User sender = new User();
	private Conversation con;
	String day;
	
	public Message() {}
	
	public Message(String c, String d, int h, int m, User s) {
		text = c;
		day = d;
		hour = h;
		min = m;
		sender = s;
	}
	
	public Message(int i, String c, String d, int h, int m) {
		mid = i;
		text = c;
		day = d;
		hour = h;
		min = m;
	}
	
	public String getText() {
		return text;
	}
	
	public String getDay() {
		return day;
	}
	
	public int getHour() {
		return hour;
	}	
	
	public int getMinute() {
		return min;
	}
	
	public void setSender(User s) {
		sender = s;
	}

	public User getSender() {
		return sender;
	}
	
	public void setText(String t) {
		text = t;
	}
	
	public void setHour(int h) {
		hour = h;
	}
	
	public void setMinute(int m) {
		min = m;
	}
	
	public void setDay(String d) {
		day = d;
	}
	
	public String toString() {
		String s = "Message date = " + getDay() + " message time = " + getHour() + ":" + getMinute() + " and text = " + getText() + " sent by: " + sender.toString();
		return s;
	}
}
